package com.zzyx.service.impl;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.hibernate.criterion.DetachedCriteria;

import com.zzyx.bean.Admin;
import com.zzyx.dao.AdminDAO;
import com.zzyx.service.AdminService;

@SuppressWarnings("unchecked")
public class AdminServiceImpl implements AdminService {
	private AdminDAO adminDao;

	public AdminDAO getAdminDao() {
		return adminDao;
	}

	public void setAdminDao(AdminDAO adminDao) {
		this.adminDao = adminDao;
	}

	public void delete(Admin entity) {
		adminDao.delete(entity);
	}

	public void deleteAll(Collection<Admin> c) {
		adminDao.deleteAll(c);

	}

	public void deleteById(Class<Admin> entityClass, Integer id) {
		adminDao.deleteById(entityClass, id);
	}

	public List<Admin> findAll(Class<Admin> entityClass) {
		return adminDao.findAll(entityClass);
	}

	public List<Admin> findByAll(DetachedCriteria dc) {
		return adminDao.findByAll(dc);
	}

	public List<Admin> findByCriteria(DetachedCriteria dc, int firstResult,
			int maxResult) {
		return adminDao.findByCriteria(dc, firstResult, maxResult);
	}

	public List<Admin> findByCriteria(DetachedCriteria dc) {
		return adminDao.findByCriteria(dc);
	}

	public List<Admin> findByHql(String hql, Map<String, Object> param,
			int firstResult, int maxResult) {
		return adminDao.findByHql(hql, param, firstResult, maxResult);
	}

	public Admin findById(Class<Admin> entityClass, Integer id) {
		return adminDao.findById(entityClass, id);
	}

	public List<Admin> findByProperty(Class<Admin> entityClass,
			String propertyName, Object value, int type) {
		return adminDao.findByProperty(entityClass, propertyName, value, type);
	}

	public Admin findUniqueResult(String sql) {
		return adminDao.findUniqueResult(sql);
	}

	public void save(Admin entity) {
		adminDao.save(entity);
	}

	public void saveOrUpdate(Admin entity) {
		adminDao.saveOrUpdate(entity);
	}

	public void update(Collection<Admin> c) {
		adminDao.update(c);
	}
}
